package com.example.metodo_post;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class editar_cliente extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.editar_cliente);
        String server_url = getIntent().getStringExtra("server_url");
		
		ListView lista = (ListView) findViewById(R.id.listview);
		web_page url = new web_page();
		List<String> listaArray = new ArrayList<String>();
		listaArray = url.metodo_retorno(server_url);
		
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listaArray);
		
		List<Map<String, String>> data = new ArrayList<Map<String, String>>();
		for (RSSItem item : feed.getAllItems()) {
		    Map<String, String> datum = new HashMap<String, String>(2);
		    datum.put("title", item.getTitle());
		    datum.put("date", item.getDate().toString());
		    data.add(datum);
		
		
		SimpleAdapter adapters = new SimpleAdapter(this, data, android.R.layout.simple_list_item_2, new String[] {"title", "date"},
                new int[] {android.R.id.text1, android.R.id.text2});
		
		lista.setAdapter(adapter);
		
	}

}
